GBML manual / Backgrounds

background_blocky

Marks a background as blocky, or not, so a look from screen_mosaic can turn it into big square blocks. bg is a background made with background_create. With no mosaic look on, a marked background looks just the way it did. Does nothing for nothing, or for a background that is gone.

Works differently on Game Boy - The Game Boy marks the room's picture as blocky; as on the Advance a mark alone changes nothing, and screen_mosaic then makes it blocky in height only.

Works differently on Game Boy Color - The Game Boy Color marks the room's picture as blocky; as on the Advance a mark alone changes nothing, and screen_mosaic then makes it blocky in height only.

Sega Genesis: not available

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

background_blocky(bg, on)

Arguments

NameType
bgbackground
onbool

Returns

Nothing.

Description

Marks a background as blocky, or takes the mark off again. A marked background is drawn in big square blocks while a mosaic look is on, and screen_mosaic decides how big the blocks are on each row. It is how a picture comes into focus, or turns into big pixels.

A real capture, two pictures of the same pine forest at dusk with a striped lighthouse, with a MOSAIC_BLOCKS look on - in the first the forest is sharp, because it is not marked; in the second the forest is marked blocky and is drawn in square blocks 8 pixels across, while the lighthouse stays sharpA real capture, two pictures of the same pine forest at dusk with a striped lighthouse, with a MOSAIC_BLOCKS look on - in the first the forest is sharp, because it is not marked; in the second the forest is marked blocky and is drawn in square blocks 8 pixels across, while the lighthouse stays sharp
A real capture, two pictures of the same pine forest at dusk with a striped lighthouse, with a MOSAIC_BLOCKS look on - in the first the forest is sharp, because it is not marked; in the second the forest is marked blocky and is drawn in square blocks 8 pixels across, while the lighthouse stays sharp

The page's example in the room. Left: a mosaic look is on, but the forest is not marked, so it stays sharp. Right: the forest is marked, so it turns into blocks. The lighthouse is a sprite and stays sharp either way. Real pictures from a Game Boy Advance ROM.

You give it two things:

On its own it changes nothing you can see

A marked background looks exactly the way it did until a mosaic look is on. The mark only says "this one may be blocky". It is screen_mosaic that decides how big the blocks are, row by row.

Only backgrounds

This call marks a background you made with background_create, and nothing else. An object is marked with sprite_blocky (everything it draws, text included), and the tiles of a room with Tile blocks in the Room Properties. Anything not marked stays sharp when a mosaic look is on.

What it costs

Nothing to run, and no slot. It only sets a mark on the background, which the console reads when it draws. The mark stays until you change it or destroy the background.

Example

pic = background_create(0, 0, ts_doc_dungeon);
background_blocky(pic, true);

A background that will turn into blocks as soon as a screen_mosaic look is on.

pic = background_create(0, 0, ts_doc_dungeon);

if (pic != nothing) {
    background_blocky(pic, true);
}

background_create gives back nothing when there is no room for another background, so it is safer to check before using what it gave back. To take the mark off again, call background_blocky(pic, false): the background stays sharp, whatever the mosaic look does.

On the GBA

Costs nothing to run and holds no slot: it only sets a flag on the background, which the console reads when it draws. The console makes a marked background blocky with the block size screen_mosaic sets row by row; with no mosaic look the block size is one pixel, so nothing changes. The flag stays on the background until you change it or destroy the background. It works on a background made by background_create and no other.

See also: screen_mosaicsprite_blockybackground_createbackground_see_throughdraw_background